<template>
  <view class="SetGesturePWD">
    <van-popup v-model:show="showPwd" style="width: 100%; height: 100%">
    	<Mypwd @handPwd="handPwd" :state="1" :pwd="pwd" style="height: 100%"></Mypwd>
    </van-popup>
  </view>
</template>

<script>
	import {ref} from 'vue'
import Mypwd from '../../components/GesturePWD.vue'
import { useStore } from "vuex";
import {onLoad} from "@dcloudio/uni-app"
export default {
  components: { Mypwd },
  props: {},
  setup() {
    const store = useStore();
		const showPwd = ref(false);
		onLoad(() =>{
			showPwd.value = true
		})
    const handPwd = (val) => {
      console.log(val);
      let data = store.state;
      console.log(data,'data');
      localStorage.setItem("pwd", val.pwd);
      localStorage.setItem("userObj",JSON.stringify(data));
      setTimeout(() => {
       uni.switchTab({
       	url: '/pages/index/index'
       });
      }, 800);
    };
    return {
			showPwd,
      // clickLift,
      handPwd,
    };
  },
};
</script>
<style lang="scss" scoped>
.SetGesturePWD {
  width: 100%;
  height: 100%;
}
:deep(.van-popup--center) {
	max-width: 100vw !important;
}
</style>
